package com.hx.ycy.web.websocket;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Created by hx-pc on 16-11-1.
 */
public class Pool<T> {

    public static List pool;

    static {
        pool = new CopyOnWriteArrayList<>();
    }

    public static Object object = new Object();

    public Pool append(T t) {
        pool.add(t);
        return this;
    }

    public Pool remove(T t) {
        pool.remove(t);
        return this;
    }

    public List<T> getSyncPool() {
        synchronized (object) {
            return pool;
        }
    }

    public List<T> getAsyncPool() {
        return pool;
    }

}
